package com.example.kotlindemo.协程

typealias OnCompleteT<T> = (Result<T>)->Unit

interface Dispose {
    fun dispose()
}

class CompletionHandleDisposeable<T>(
    val job:Job,
    val onComplete:OnCompleteT<T>
):Dispose{
    override fun dispose() {
        job.remove(this)
    }
}

//class CompletionHandleDisposeable<T>(
//    val job:Job,
//    val onCancle:OnCancle<T>
//):Dispose{
//    override fun dispose() {
//        job.remove(this)
//    }
//}

